{include file="head" /}

{include file="menu" /}
<section id="main-content">
    <section class="wrapper">
        <a href="{:url('frontend/add')}"><button type="submit" class="btn btn-danger">添加</button></a>

        <br><br>
        <div class="row">
            <div class="col-lg-12">
                <section class="panel">
                    <header class="panel-heading">
                        首页轮播
                    </header>
                    <table class="table table-striped table-advance table-hover">
                        <thead class="ordertable">
                        <tr>
                            <th>id</th>
                            <th>图片地址</th>
                            <th>标题</th>
                            <th>内容</th>
                            <th>状态</th>
                            <th>创建时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="data" id="vo"}
                            <tr>
                                <td>{$vo.id}</td>
                                <td>{$vo.filepath}</td>
                                <td>{$vo.title}</td>
                                <td>{$vo.text}</td>
                                <td>{$vo.isdie}</td>
                                <td>{$vo.create_at}</td>
                                <td>
                                    <button class="btn btn-danger btn-xs" onclick="deleteinfo('{$vo.id}')" title="点击删除"><i class="icon-trash "></i></button>
                                </td>
                            </tr>
                        {/volist}
                        </tbody>
                    </table>
                </section>
    </section>
    <!--main content end-->
</section>

{include file="foot" /}

<script>
    function deleteinfo(id){
        layer.open({
            content: '确定删除吗',
            yes: function(index){
                //do something
                var url = "{:url('delslide')}"+"?id="+id;

                $.get(url,function(data){
                    if (data.type == 1) {
                        layer.msg(data.data, {icon: 1,time: 1000},function(){
                            window.location.href="{:Url('index')}";
                        });

                    }else if(data.type == -1){
                        layer.msg(data.data, {icon: 2});
                    }
                });
            }
        });
    }


</script>